import "dotenv/config";
import { ChatOpenAI } from "@langchain/openai";
import { StringOutputParser } from "@langchain/core/output_parsers";

const chatbot = new ChatOpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  configuration: {
    baseURL: process.env.OPENAI_API_BASE,
  },
});
const parser = new StringOutputParser();
const newChatbot = chatbot.pipe(parser);
const result = await newChatbot.invoke("2025-04-14 是周几");
console.log(result);
